#! python 3
#   Fred @ 190513
#-*- coding: utf-8 -*-

import sys
import os
import json
import csv

curFolder = sys.path[0]+"\\"
sourcejsonname = curFolder + "clh.txt"
targetcsvname = curFolder + "clh_r.txt"

tmp = open(targetcsvname, "w+", encoding='utf-8')

offset = 2

if(os.path.exists(sourcejsonname)):
    with open(sourcejsonname,"r+", encoding='utf-8') as f :
        for l in f.readlines():
            if l.strip() != "" and len(l) > offset:
                #print(l)
                #print(l)
                #print(len(l)-offset)
                tmp.write(l[offset:(len(l)-1)] + '\r')
            else:
                tmp.write("")
                #print('')
            
            
else:
    print("no that file")

tmp.close()

print('done')